package com.authsystem.service.impl;

import com.authsystem.entity.Role;
import com.authsystem.mapper.RoleMapper;
import com.authsystem.service.RoleService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
@RequiredArgsConstructor
public class RoleServiceImpl implements RoleService {

    private final RoleMapper roleMapper;

    @Override
    public Role getRoleWithMenusById(Long roleId) {
        return roleMapper.selectRoleWithMenusById(roleId);
    }

    @Override
    public Role getRoleWithMenusByRoleKey(String roleKey) {
        return roleMapper.selectRoleWithMenusByRoleKey(roleKey);
    }

    @Override
    public List<Role> getAllRoles() {
        return roleMapper.selectAllRoles();
    }
}